package com.xuhao.examai.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class SwaggerConfig {

	@Bean
	public OpenAPI customOpenAPI() {
		return new OpenAPI()
				.info(new Info()
						.title("用户服务 API")
						.description("考试AI系统用户管理微服务API文档")
						.version("1.0.0")
						.contact(new Contact()
								.name("Exam AI Team")
								.email("support@examai.com")
								.url("https://github.com/examai"))
						.license(new License()
								.name("MIT License")
								.url("https://opensource.org/licenses/MIT")))
				.servers(List.of(
						new Server().url("http://localhost:8081").description("开发环境"),
						new Server().url("https://api.examai.com").description("生产环境")));
	}
}